//
//  NavigationProtocol.swift
//  YYProject
//
//  Created by 陆文宇 on 2017/8/29.
//  Copyright © 2017年 陆文宇. All rights reserved.
//

import UIKit

protocol NavigationProtocol {
    
    func yy_shouldPop() -> Bool
    
}

extension NavigationProtocol {
    
    func yy_push(vc: YYController) {
        YYRouter.currentVC.navigationController?.pushViewController(vc, animated: true)
    }
    
    func yy_pop() {
        YYRouter.currentVC.navigationController?.popViewController(animated: true)
    }
    
    func yy_present(vc: YYController) {
        let nc = UINavigationController(rootViewController: vc)
        YYRouter.currentVC.present(nc, animated: true, completion: nil)
    }
    
    func yy_dismiss() {
        YYRouter.currentVC.navigationController?.dismiss(animated: true, completion: nil)
    }
    
}

